<?php
// +----------------------------------------------------------------------
// | auth设置
// +----------------------------------------------------------------------

use app\model\communal\CustomerModel;
use app\model\communal\UserExpertModel;
use app\model\communal\UserModel;
use app\model\communal\AdminModel;

return [
    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option controls the default authentication "guard" and password
    | reset options for your application. You may change these defaults
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => 'backend',
        'passwords' => 'users',
    ],

    /*
    |--------------------------------------------------------------------------
    | Authentication Guards
    |--------------------------------------------------------------------------
    |
    | Next, you may define every authentication guard for your application.
    | Of course, a great default configuration has been defined for you
    | here which uses session storage and the Eloquent user provider.
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | Supported: "session", "token"
    |
    */

    'guards' => [

        /*
         * 用户端
         */
        'user' => [
            'driver' => 'jwt',
            'provider' => 'users',
        ],

        /*
         * 专家端
         */
        'expert' => [
            'driver' => 'jwt',
            'provider' => 'experts',
        ],


        /*
         * 平台
         */
        'backend' => [
            'driver' => 'jwt',
            'provider' => 'admins',
        ],

        /*
         * 客服
         */
        'customer' => [
            'driver' => 'jwt',
            'provider' => 'customers',
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | User Providers
    |--------------------------------------------------------------------------
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | If you have multiple user tables or models you may configure multiple
    | sources which represent each model / table. These sources may then
    | be assigned to any extra authentication guards you have defined.
    |
    | Supported: "database", "eloquent"
    |
    */

    'providers' => [

        /*
         * 用户登录
         */
       'users' => [
           'driver' => 'model',
           'model' => UserModel::class,
       ],

        /*
         * 专家登录
         */
        'experts' => [
            'driver' => 'model',
            'model' => UserExpertModel::class,
        ],

        /*
         * 管理员登录
         */
        'admins' => [
            'driver' => 'model',
            'model' => AdminModel::class,
        ],

        /*
         * 客服登录
         */
        'customers' => [
            'driver' => 'model',
            'model' => CustomerModel::class,
        ],
    ],
];
